package com.ruoyi.project.data.service.impl;

import com.ruoyi.project.data.domain.TradeRecords;
import com.ruoyi.project.data.mapper.DatTradeMapper;
import com.ruoyi.project.data.service.IDatTradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DatTradeServiceImpl implements IDatTradeService {
    @Autowired
    private DatTradeMapper  datTradeMapper;
    @Override
    public TradeRecords findTradeRecords(TradeRecords tradeRecords) {
        Double tr1=datTradeMapper.selectTradeRecords1(tradeRecords);
        Double tr2=datTradeMapper.selectTradeRecords2(tradeRecords);
        Double tr3=datTradeMapper.selectTradeRecords3(tradeRecords);
        Double tr4=datTradeMapper.selectTradeRecords4(tradeRecords);
        if (tr1==null){
            tr1=0.0;
        }
        if (tr2==null){
            tr2=0.0;
        }
        if (tr3==null){
            tr3=0.0;
        }
        if (tr4==null){
            tr4=0.0;
        }
        TradeRecords tr =new TradeRecords(tr1,tr2,tr3,tr4);
        return tr;
    }
}
